function [ ptsx, ptsy ] = Wrap_imPoint_to_affine(ptsx, ptsy, para, retun_affine_img)
% orig(1,1) ===> center point  
% affine @para ==> similarity transformation 
% if retun_affine_img =1  orig  center point ==> (1,1)
% else   orig == center point  (no change)
% @ptsx---(x, y)   not (y x)
% 

if nargin == 3, retun_affine_img = 1; end
    
    xycombine   =   0;
    if(isempty(ptsy))
       ptsy     =   ptsx(:,2:2:end);
       ptsx     =   ptsx(:,1:2:end);
       xycombine = 1;
    end
    
    
    ptsx    =   ptsx - para.c(1);
    ptsy    =   ptsy - para.c(2);
    if retun_affine_img 
        [ptsx, ptsy] = shape_transform(ptsx, ptsy, para.f(1:2), para.c);
    else
        [ptsx, ptsy] = shape_transform(ptsx, ptsy, para.f(1:2), [0 0]);
    end
    
    if xycombine
        ptsx = combine_divid_xy(ptsx,ptsy);
        ptsy = [];
    end
    
    
end

